<template>
  <div class="app">
    省份
    <select name="province" id="province" @input="$emit('updateProvince', $event.target.value)">
        <option value="">请选择</option>
        <option :value="v.id" v-for="v in provinces" :key="v.id">{{ v.name }}</option>
    </select>
    性别
    <input id="male" type="radio" name="gender" :checked="gender === 1" value="1" @input="$emit('changeGender', $event.target.value)"><label for="male">男</label>
    <input id="female" type="radio" name="gender" :checked="gender === 2" value="2" @input="$emit('changeGender', $event.target.value)"><label for="female">女</label>
    兴趣
    <input id="swimming" type="checkbox" name="hobby" :checked="hobby === 'swimming'" value="swimming" @input="$emit('changeHobby', $event.target.value)"><label for="swimming">游泳</label>
    <input id="xiaqi" type="checkbox" name="hobby" :checked="hobby === 'xiaqi'" value="xiaqi" @input="$emit('changeHobby', $event.target.value)"><label for="xiaqi">下棋</label>
    <input id="basketball" type="checkbox" name="hobby" :checked="hobby === 'basketball'" value="basketball" @input="$emit('changeHobby', $event.target.value)"><label for="basketball">篮球</label>
  </div>
</template>

<script>
export default {
    name:'SonSelect',
    props: {
        provinces: {
            type: Array
        },
        gender: {
            type:Number
        },
        hobby: {
            type:String
        }
    }
}
</script>

<style>

</style>